/**
 * 中文格式日期 + 星期
 */
Date.prototype.getChinaDate = function () {
    var date = arguments[0];
    var weekList = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
    var year = date.getFullYear();
    var month = date.getMonth() + 1;
    month = month < 10 ? "0" + month : month;
    var day = date.getDate();
    day = day < 10 ? "0" + day : day;
    var hour = date.getHours();
    hour = hour < 10 ? "0" + hour : hour;
    var min = date.getMinutes();
    min = min < 10 ? "0" + min : min;
    var sec = date.getSeconds();
    sec = sec < 10 ? "0" + sec : sec;
    var week = weekList[date.getDay()];
    return year + "年" + month + "月" + day + "日 " + hour + "时" + min + "分" + sec + "秒 " + week;
}
/**
 * 自定义日期格式
 */
Date.prototype.dateFormat = function () {
    var date = arguments[0];
    var str = arguments[1];
    var year = date.getFullYear();
    var month = date.getMonth() + 1;
    month = month < 10 ? "0" + month : month;
    var day = date.getDate();
    day = day < 10 ? "0" + day : day;
    var hour = date.getHours();
    hour = hour < 10 ? "0" + hour : hour;
    var min = date.getMinutes();
    min = min < 10 ? "0" + min : min;
    var sec = date.getSeconds();
    sec = sec < 10 ? "0" + sec : sec;
    return str.replace("yyyy", year).replace("mm", month).replace("dd", day).replace("hh", hour).replace("SS", min).replace("ss", sec);
}
/**
 * 当前月份第一天是星期几
 */
Date.prototype.getMonthFirstDayWeek = function () {
    var date = arguments[0];
    var tempDate = new Date("2000-1-1");
    tempDate.setFullYear(date.getFullYear());
    tempDate.setMonth(date.getMonth());
    tempDate.setDate(1);
    return tempDate.getDay();
}
/**
 * 上一个月份的天数
 */
Date.prototype.getPrevMonthDays = function () {
    var date = arguments[0];
    var tempDate = new Date("2000-1-1");
    tempDate.setFullYear(date.getFullYear());
    tempDate.setMonth(date.getMonth());
    tempDate.setDate(0);
    return tempDate.getDate();
}
/**
 * 当前月份的天数
 */
Date.prototype.getMonthDays = function () {
    var date = arguments[0];
    var tempDate = new Date("2000-1-1");
    tempDate.setFullYear(date.getFullYear());
    tempDate.setMonth(date.getMonth() + 1);
    tempDate.setDate(0);
    return tempDate.getDate();
}
